define([
        'app/utils/WeixinUtils',
        'text!app/tpl/pc_login.html',
        'app/service/ConfigService'
        
        ], function (
        WeixinUtils,
        pc_loginTpl,
        ConfigService
    ) {

    

    var controller = function () {

        //0. Weixin Disabled
        WeixinUtils.disableAll();

        
        //1. Data Initialized
        ConfigService.init(function(resp){
    

            console.log(resp);

            //2. Weixin Initialized
            WeixinUtils.disableAll();


            //3. tpl Initialized - Never change!!!
            var tpl = WebUtils.tplInitialized();

            //4. UI Initialized
            var pc_loginUI = _.template(pc_loginTpl)({
                "appid": resp.result.appid,
                "redirect_uri": resp.result.redirect_uri,
                "state": resp.result.state
            });

            //4. Assemble
            tpl.append(pc_loginUI);

            //5. Render - Never change!!!
            WebUtils.render(tpl);

            //6. Directive initialized
            // ConfigDirective.directive_inputName();
            // LoginDirective.directive_inputTel();
            // LoginDirective.directive_avatar1();
            // LoginDirective.directive_login1();


        });


      


        //7. routechange - Never change!!!
        controller.onRouteChange = WebUtils.routeChange;

    };

    return controller;


});
